<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('user_id')->comment('自增id号，管理员代码');
            $table->string('users_name')->comment('管理员登陆名');
            $table->string('email')->comment('管理员邮箱');
            $table->string('password')->comment('管理员登陆密码');
            $table->tinyInteger('add_time')->comment('管理员添加时间');
            $table->tinyInteger('last_login')->comment('管理员最后一次登陆时间');
            $table->string('last_ip')->comment('管理员最后一次登陆IP');
            $table->longText('action_list')->comment('管理员管理权限列表');
            $table->longText('nav_list')->comment('管理员导航栏配置项');
            $table->string('lang_type')->comment('lang_type');
            $table->smallInteger('agency_id')->comment('改管理员负责的办事处理的id，同agency的agency_id字段，如果管理员没有负责办事处，则此处为0');
            $table->smallInteger('suppliers')->comment('suppliers');
            $table->longText('todolist')->comment('记事本记录的数据');
            $table->smallInteger('role_id')->comment('role_id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
